# -*- coding: utf-8 -*-
"""
以某目录为根目录，进行文件系统内路径结构信息同步
"""
import sys

import pymysql

if '../../' not in sys.path:
    sys.path.append('../../')

from const_var import DB_CONFIG
import table_file_tree

conn = pymysql.connect(host=DB_CONFIG['host'], port=DB_CONFIG['port'], user=DB_CONFIG['user'],
                       passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], charset='utf8')
c = conn.cursor()
c.execute("truncate table file_tree;")
conn.commit()
conn.close()
table_file_tree.copy_fs_info_from_os_to_db('E:\\zhfs\\', 'zhfs')
